package stu.sup.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import stu.sup.entity.MerchantsInfo;
import stu.sup.entity.MerchantsInfoExample;

import java.util.List;

public interface MerchantsInfoMapper {
    int countByExample(MerchantsInfoExample example);

    int deleteByExample(MerchantsInfoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MerchantsInfo record);

    int insertSelective(MerchantsInfo record);

    List<MerchantsInfo> selectByExample(MerchantsInfoExample example);

    MerchantsInfo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MerchantsInfo record, @Param("example") MerchantsInfoExample example);

    int updateByExample(@Param("record") MerchantsInfo record, @Param("example") MerchantsInfoExample example);

    int updateByPrimaryKeySelective(MerchantsInfo record);

    int updateByPrimaryKey(MerchantsInfo record);

    /**
     * 根据用户id查询个人信息
     */
    @Select("select mi.* from merchants_info mi join merchants m on mi.merchants_id = m.id and m.id = #{merchantsId}")
    MerchantsInfo findByMerchantsId(Integer merchantsId);
}